<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-sales-add">
        <div class="form-group">
            <label class="col-sm-3 control-label">售房编号：</label>
            <div class="col-sm-8">
                <input name="salesNum" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">销售人员：</label>
            <div class="col-sm-8">
                <select name="salesPersonNum" class="form-control m-b">
                    <option selected hidden value="">-请选择销售人员-</option>
                    <option th:each="dict : ${sysUsers}" th:value="${dict.userName}"  th:text="${dict.userName}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">房间号：</label>
            <div class="col-sm-8">
                <input name="roomNum" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">价格：</label>
            <div class="col-sm-8">
                <input name="salesPeice" class="form-control" type="text">
            </div>
            <span style="margin-top: 3px">每平米</span>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">房型：</label>
            <div class="col-sm-8">
            <select name="salesApartment" th:with="type=${@dict.getType('sys_room_type')}" class="form-control">
                <option selected hidden value="">-请选择房源类型-</option>
                <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                        th:value="${dict.dictValue}"></option>
            </select>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">预付款：</label>
            <div class="col-sm-8">
                <input name="salesAdvanceCharge" class="form-control" type="text">
            </div>
            <span style="margin-top: 3px">万元</span>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">成交价：</label>
            <div class="col-sm-8">
                <input name="salesTransactionPrice" class="form-control" type="text">
            </div>
            <span style="margin-top: 3px">万元</span>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">购房人：</label>
            <div class="col-sm-8">
                <input name="purchaseName" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">出售日期：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <input name="salesDate" class="form-control" placeholder="yyyy-MM-dd" type="text">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">是否交付：</label>
            <div class="col-sm-8">
                <div class="radio-box" th:each="dict : ${@dict.getType('sys_sales_flag')}">
                    <input type="radio" th:id="${dict.dictCode}" name="flag" th:value="${dict.dictValue}" th:checked="${dict.default}">
                    <label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
                </div>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
    var prefix = ctx + "system/sales"
    $("#form-sales-add").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/add", $('#form-sales-add').serialize());
        }
    }

    $("input[name='salesDate']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });
</script>
</body>
</html>